package com.sooncode.project.focusservice.controller;

import com.sooncode.project.focusservice.model.CourseLatitude;
import com.sooncode.project.focusservice.service.CourseLatitudeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("courseLatitude")
public class CourseLatitudeController {
    @Autowired
    private CourseLatitudeService service;

    @PostMapping("courseLatitude")
    public boolean add(@RequestParam Map map){
        return service.add(map);
    }
    @PutMapping("courseLatitude")
    public boolean modify(@RequestParam String id,@RequestParam Map map){
        return service.modify(id,map);
    }
    @DeleteMapping("courseLatitude")
    public boolean delete(@RequestParam String[] ids){
        for(String id:ids){
            service.delete(id);
        }
        return true;
    }
    @GetMapping("courseLatitudes")
    public List<CourseLatitude> getList(){

        return service.getList();
    }
}
